package com.heima.mapper;

import com.heima.poji.Emp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface EmpMapper {


//    @Select("select count(*) from emp;")
//    Long empSum();
//
//    @Select("select * from emp limit  #{page1},#{pageSize};")
//    List<Emp> list(Integer page1, Integer pageSize);
//    @Select("select * from emp")
    List<Emp> list(String name, Short gender, LocalDate begin,
                   LocalDate end);

    void delectById(List<Integer> ids);

    void insetEmp(Emp emp);

    @Select("select * from emp where id = #{id} ")
    Emp SelctById(Integer id);

    void updateById(Emp emp);


    @Delete("delete from emp where dept_id = #{id} ")
    void delectByEmpId(Integer id);
}
